package com.study.hive.udf;

import org.apache.hadoop.hive.ql.exec.UDF;

/**
 * UDF：输入一行，输出一行
 * hive (default)> add jar /opt/module/datas/udf.jar;
 * hive (default)> create temporary function myudf as "com.study.hive.udf.MyUDF";
 * hive (default)> select ename, myudf(ename) lowername from emp;
 *
 * @author stephen
 * @date 2019-09-06 17:02
 */
public class MyUDF extends UDF {

    public String evaluate(String word) {
        if (word == null) {
            return null;
        }
        return word.toLowerCase();
    }
}
